package com.tsd.core.openweixin.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @author eric
 */
public class AccessToken implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 544492881588990804L;
    private String token;
    private Long expiresTimestemp;

    public AccessToken() {

    }

    public AccessToken(String token, Long expiresTimestemp) {
        this.token = token;
        this.expiresTimestemp = expiresTimestemp;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Long getExpiresTimestemp() {
        return expiresTimestemp;
    }

    public void setExpiresTimestemp(Long expiresTimestemp) {
        this.expiresTimestemp = expiresTimestemp;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final AccessToken other = (AccessToken) obj;
        return Objects.equals(this.token, other.token);
    }

    @Override
    public String toString() {
        return "AccessToken{" + "token=" + token + ", expiresTimestemp=" + expiresTimestemp + "'(" + (new Date(expiresTimestemp)) + ")}";
    }

}
